fix(views): ListView reads the spec-canonical filter, so a view's base filter reaches every visualization (#2890) - #2935
Merged
Conversation
Third rename in the ListView vocabulary migration: `filters` → `filter`. Unlike the first two this closes a live bug, because the fork was asymmetric. ListView was the ONLY surface reading `filters`. Every child view — ObjectGrid, ObjectGallery, ObjectKanban, ObjectCalendar, ObjectGantt, ObjectMap, ObjectTree, ObjectChart — reads `filter`, and ListView handed them `filters`. Wherever a child fetches its own rows instead of receiving ListView's, the base filter was dropped: a `chart` list view aggregated the whole object, because the chart branch emitted `filters:` and ObjectChart reads `schema.filter`. Conversely a spec-authored view carrying `filter` — what the spec says, and what runtime-metadata-persistence and "Save as view" already persist — rendered unfiltered in ListView, because nothing read that key. Key rename only: both keys carry an ObjectQL FilterNode array everywhere in objectui and every consumer passes the value straight to `$filter`. The spec types `filter` as ViewFilterRule[], so the field is typed from the spec but used as something else — noted in the normalizer, left alone here, since converting formats inside a vocabulary fold would change what reaches the data source. Also collapses a duplicated computation in app-shell's ObjectView, which built the same effective filter twice (once as `filter` for the children, once as `filters` for ListView) with the copies subtly different — only one fell back to listSchema.filter, only the other substituted tokens in the URL filters. One computation now, keeping both behaviors. Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third rename in #2890 scope A:
filters→filter. Unlike steps 1–2 this one closes a live bug, because the fork was asymmetric.The bug
ListViewwas the only surface in the repo readingfilters. Every child view readsfilter:ObjectGrid,ObjectGallery,ObjectKanban,ObjectCalendar,ObjectGantt,ObjectMap,ObjectTree,ObjectChartschema.filterListViewschema.filters← the odd one out…and
ListViewhanded its childrenfilters. Wherever a child fetches its own rows instead of receiving ListView's, the view's base filter was silently dropped:chartlist view aggregated the whole object. The chart branch built anobject-chartnode withfilters:;ObjectChartreadsschema.filterand never readfilters, so a chart view with a base filter charted unfiltered totals.And in the other direction: a spec-authored list view — one carrying
filter, which is what the spec says and whatruntime-metadata-persistenceand "Save as view" already persist — rendered unfiltered inListView, because nothing read that key. The app-shell hosts only avoided this by convertingfilter→filterson the way in.The fix
Folded in the same
normalizeListViewSchemaas steps 1–2, plus:ListViewreadsschema.filterand emitsfilterto its children (grid path, chart path, and everybasePropsconsumer);plugin-view/ObjectView'srenderListViewpayload,app-shell/ObjectView,InterfaceListPage,ObjectDataPage, and thelist-viewregistry defaults.Key rename only — no format conversion. Both keys carry an ObjectQL FilterNode array everywhere in objectui, and every consumer passes the value straight to
$filter. Worth flagging separately: the spec typesfilterasViewFilterRule[]({field, operator, value}objects), so objectui's field is typed from the spec but used as something else. That mismatch is real; converting formats inside a vocabulary fold would change what reaches the data source, so it is documented in the normalizer and left alone.Drive-by: one filter computation instead of two
app-shell'sObjectViewbuilt the same effective filter twice — once asfilterfor the child views, once ~140 lines later asfiltersforListView— and the two copies had drifted: only the first fell back tolistSchema.filter; only the second ran token substitution over the URL filters. There is now one computation that keeps both behaviors.Verification
normalize-list-view.test.ts+4: fold, canonical-wins, verbatim value (compound['and', …]nodes must not be rewritten), non-array passthrough.ListView.test.tsx+3 consumer regressions asserting the$filteractually sent to the data source, fromfilter, from legacyfilters, and with both present.core,types,plugin-list,plugin-view,plugin-grid,plugin-charts,app-shellpass;turbo run type-check32/32; ESLint 0 errors.🤖 Generated with Claude Code